<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>医院住院部管理系统-管理员</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" th:href="@{/plugins/fontawesome-free/css/all.min.css}">
    <link rel="stylesheet" th:href="@{https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/icheck-bootstrap/icheck-bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/jqvmap/jqvmap.min.css}">
    <link rel="stylesheet" th:href="@{/dist/css/adminlte.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/overlayScrollbars/css/OverlayScrollbars.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/daterangepicker/daterangepicker.css}">
    <link rel="stylesheet" th:href="@{/plugins/summernote/summernote-bs4.css}">
    <link rel="stylesheet" th:href="@{/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css}">
    <link rel="stylesheet" th:href="@{/plugins/datatables-responsive/css/responsive.bootstrap4.min.css}">
    <link th:href="@{https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700}" rel="stylesheet">
    <style>
        .table-responsive {
            overflow-x: auto;
        }
        .table td, .table th {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .table td[data-toggle="tooltip"] {
            cursor: pointer;
        }
    </style>
</head>
<body class="hold-transition layout-top-nav">
<div class="wrapper">
    <nav class="main-header navbar navbar-expand-md navbar-light navbar-white">
        <div class="container">
            <div class="collapse navbar-collapse order-3">
                <ul class="navbar-nav">
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/index}">首页</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/patient}">患者</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/doctor}">医生</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/drug}">药物</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/exam}">检测</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/bed}">床位</a></li>
                    <li class="nav-item"><a class="nav-link" th:href="@{/admin/schedule}">排班</a></li>
                </ul>
            </div>
            <ul class="order-1 order-md-3 navbar-nav navbar-no-expand ml-auto">
                <li class="nav-link"><a class="nav-link" href="/doctor/index" th:text="${session.username}"></a></li>
                <li class="nav-link"><a class="nav-link" href="/logout" th:text="'注销'"></a></li>
            </ul>
        </div>
    </nav>
    <div class="content-wrapper">
        <div class="content-header"></div>
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-md-4 col-sm-10">
                        <div class="card">
                            <div class="card-header">
                                <div th:text="${patient.name}" class="card-title">病人</div>
                            </div>
                            <div class="card-body">
                                <form role="form" method="post" th:action="@{/admin/patientedit}">
                                    <div class="form-group">
                                        <input class="form-control" th:value="${patient.id}" type="number" readonly="readonly" name="id" required="required" hidden="hidden">
                                    </div>
                                    <div class="form-group">
                                        <label for="name">姓名</label>
                                        <input class="form-control" readonly="readonly" th:value="${patient.name}" type="text" required="required" name="name" id="name" placeholder="姓名">
                                    </div>
                                    <div class="form-group">
                                        <label for="phone">电话</label>
                                        <input class="form-control" readonly="readonly" th:value="${patient.phone}" type="tel" required pattern="^(0|86|17951)?(13[0-9]|15[012356789]|17[0678]|18[0-9]|14[57])[0-9]{8}" name="phone" id="phone" placeholder="11位电话号码">
                                    </div>
                                    <div class="form-group">
                                        <label for="addr">地址</label>
                                        <textarea name="addr" readonly="readonly" th:text="${patient.addr}" required="required" id="addr" class="form-control"></textarea>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-10 col-md-4">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title">药物</div>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="table1" class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>名称</th>
                                            <th>数量</th>
                                            <th>价格</th>
                                            <th>患者</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr th:each="d:${drugs}">
                                            <td th:text="${d.drugname}" data-toggle="tooltip" title="${d.drugname}"></td>
                                            <td th:text="${d.number}"></td>
                                            <td th:text="${d.price}"></td>
                                            <td th:text="${d.patient.name}"></td>
                                            <td th:text="${d.creatDate}"></td>
                                            <td>
                                                <a class="btn btn-primary" th:href="@{'/admin/drugedit/'+${d.id}}">编辑</a>
                                                <a class="btn btn-warning" th:href="@{'/admin/drugdel/'+${d.id}}">删除</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-10 col-md-4">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title">检测</div>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="table2" class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>内容</th>
                                            <th>价格</th>
                                            <th>检测时间</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr th:each="e:${exams}">
                                            <td th:text="${e.content}" data-toggle="tooltip" title="${e.content}"></td>
                                            <td th:text="${e.price}"></td>
                                            <td th:text="${e.checkTime}"></td>
                                            <td th:text="${e.creatTime}"></td>
                                            <td>
                                                <a class="btn btn-primary" th:href="@{'/admin/examedit/'+${e.id}}">编辑</a>
                                                <a class="btn btn-warning" th:href="@{'/admin/examdel/'+${e.id}}">删除</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div th:insert="temp::footer"></div>
</div>
<script th:src="@{/plugins/jquery/jquery.min.js}"></script>
<script th:src="@{/plugins/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/dist/js/adminlte.min.js}"></script>
<script th:src="@{/dist/js/demo.js}"></script>
<script th:src="@{/plugins/datatables/jquery.dataTables.min.js}"></script>
<script th:src="@{/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js}"></script>
<script th:src="@{/plugins/datatables-responsive/js/dataTables.responsive.min.js}"></script>
<script th:src="@{/plugins/datatables-responsive/js/responsive.bootstrap4.min.js}"></script>
<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>
</body>
</html>
